/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import type { Field } from './type';
import { getBrandList } from '@/services/jdk/shield';

export const deliveryValueEnum = {
  '0': '平台运力',
  '1': '自运力',
};
export const typeValueEnum = {
  '1': '接单',
  '2': '到店',
  '3': '配送',
  '4': '完成',
  '5': '异常',
  '7': '取消',
};
const fromValueEnum = {
  '1': '运力',
  '2': '运力快递员',
  '3': '自运力',
};

const publishValueEnum = {
  '1': '重发',
  '0': '不重发',
};

export const FieldList: Field[] = [
  {
    name: 'delivery_brand',
    node: 'input',
    keys: ['1', '7'],
    message: '运力品牌标识',
    request: getBrandList,
  },
  {
    name: 'delivery_order_no',
    node: 'input',
    keys: ['1'],
    message: '运力单号',
  },
  {
    name: 'courier_name',
    node: 'input',
    keys: ['1'],
    message: '接单配送员名字',
  },
  {
    name: 'courier_phone',
    node: 'input',
    keys: ['1'],
    message: '接单配送员电话',
  },
  {
    name: 'delivery_distance',
    node: 'input',
    keys: ['1'],
    message: '配送距离',
    addonAfter: '米',
  },
  {
    name: 'from',
    node: 'input',
    keys: ['7'],
    message: '取消触发者',
    valueEnum: fromValueEnum,
  },
  {
    name: 'total_fee',
    node: 'input',
    keys: ['1', '4'],
    message: '原价',
    addonAfter: '（元）',
  },
  {
    name: 'real_fee',
    node: 'input',
    keys: ['1', '4'],
    message: '实际价',
    addonAfter: '（元）',
  },
  {
    name: 'tip_fee',
    node: 'digit',
    keys: ['1', '4'],
    message: '小费',
    addonAfter: '（元）',
    fieldProps: { precision: 0, min: 0, max: 1000 },
  },
  {
    name: 'auto_publish',
    node: 'select',
    keys: ['7'],
    initialValue: '0',
    message: '禁止重新发单',
    valueEnum: publishValueEnum,
  },
  {
    name: 'deduct_fee',
    node: 'input',
    keys: ['7'],
    message: '扣除金额',
    rules: false,
    addonAfter: '（元）',
  },
  {
    name: 'reason',
    node: 'input',
    keys: ['7'],
    message: '取消原因',
    rules: false,
  },
  {
    name: 'reason',
    node: 'input',
    keys: ['5'],
    message: '异常原因',
  },
  {
    name: 'is_fn_school',
    node: 'checkbox',
    keys: ['1', '2', '3', '4', '5', '6', '7'],
    label: '是否蜂鸟高校订单',
    rules: false,
    message: '是否蜂鸟高校订单',
  },
];
